package com.niiwoo.civet.user.dto.request;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.niiwoo.civet.user.enums.JPushEnum;

import java.io.Serializable;

/**
 * 极光推送扩展信息参数
 * @author xueyuke
 * @date 2017-12-16
 */
public class JPushExtDTO implements Serializable {
	private static final long serialVersionUID = 952533506808703559L;
	/**
	 * 跳转页面类型
	 */
	@JSONField(name="redirectPage")
	private JPushEnum.RedirectPageEnum redirectPageEnum;

	@JSONField(deserialize = false)
	public void setRedirectPageEnum(JPushEnum.RedirectPageEnum redirectPageEnum) {
		this.redirectPageEnum = redirectPageEnum;
	}

	@JSONField(name="redirectPage")
	public String getRedirectPage(){
		return redirectPageEnum.getPage();
	}

	public static void main(String[] args){
		JPushExtDTO jPushExtDTO=new JPushExtDTO();
		jPushExtDTO.setRedirectPageEnum(JPushEnum.RedirectPageEnum.SPEED_LOAN_HOME_PAGE);

		System.out.println(JSON.toJSONString(jPushExtDTO));
	}
}
